﻿#region Imports
using System.Drawing;
#endregion

namespace CheckerWin.Utils
{
    public class Operators
    {
        #region Operators
        /// <summary>
        /// Evaluates the opposite value (horizontally) to the specified value
        /// </summary>
        /// <param name="a">Specified value to be evaluated against</param>
        /// <returns>Value opposite (horizontally) to the specified value</returns>
        /// <seealso cref="http://msdn.microsoft.com/en-us/library/8edha89s.aspx" />
        /// <seealso cref="http://msdn.microsoft.com/en-us/library/aa691324%28v=vs.71%29.aspx" />
        public static ContentAlignment operator !(ContentAlignment a)
        {
            ContentAlignment cont = ContentAlignment.MiddleCenter;

            // Top
            if (cont == ContentAlignment.TopLeft) return ContentAlignment.TopRight;
            else if (cont == ContentAlignment.TopRight) return ContentAlignment.TopLeft;
            // Middle
            else if (cont == ContentAlignment.MiddleLeft) return ContentAlignment.MiddleRight;
            else if (cont == ContentAlignment.MiddleRight) return ContentAlignment.MiddleLeft;
            // Right
            else if (cont == ContentAlignment.BottomLeft) return ContentAlignment.BottomRight;
            else if (cont == ContentAlignment.BottomRight) return ContentAlignment.BottomLeft;

            return cont;
        }
        #endregion
    }
}
